const state = {
    videoShow: false,//控制视频框显示隐藏
    picShow:false,//超速控制图片框
    videoUrl:"",//视频弹窗url
    socketMessage:"",
    showOff:true ,//控制隐藏整个画面
    showOffRight:true,//
    planeData:[],//保存无人机便于关闭
    planeDataList:{},//无人机数据
    planeOff:false,
    historyOff:{
      status:false,
      source:0
    },//历史记录弹窗
    planeWinOff:false,
    saveKaKouLng:[],//保存卡口经纬度
    editOff:false,
   
  };
  const actions = {
    seteditOff({ commit }, data){
      commit("seteditOff", data);
    },
    setKaKouLng({ commit }, data){
      commit("setKaKouLng", data);
    },
    setVideoShow({ commit }, data) {
      commit("setVideoShow", data);
    },

    setPicShow({ commit }, data) {
      commit("setPicShow", data);
    },
    setSocketMessage({ commit }, data) {
      commit("setSocketMessage", data);
    },
    setSocketVideoUrl({ commit }, data) {
      commit("setSocketVideoUrl", data);
    },
    setShowOff({ commit }, data) {
      
      commit("setShowOff", data);
    },
    setShowOffRight({ commit }, data) {
      
      commit("setShowOffRight", data);
    },
    setPlaneData({ commit }, data) {
      commit("setPlaneData", data);
    },
    setPlaneOff({ commit }, data) {
      commit("setPlaneOff", data);
    },
    setHistoryOff({ commit }, data) {
      commit("setHistoryOff", data);
    },

    setPlaneWinOff({commit},data){
      commit("setPlaneWinOff", data);
    },
    setPlaneDataList({commit},data){
      commit("setPlaneDataList", data);
    }
   
  };
  const mutations = {
    seteditOff(state, data){
       
        state.editOff = data;
      
     
      
    },
     /*
    * ******************** 
    *  保存卡口经纬度
    * ********************
    */
    setKaKouLng(state, data){
      state.saveKaKouLng = data;
    },
    /*
    * ******************** 
    *  控制视屏框显示隐藏
    * ********************
    */
    setVideoShow(state, data) {
      // if(data){
      //   state.picShow = false;
      // }
      state.videoShow = data;
    },
     /*
    * ******************** 
    *  超速控制图片框
    * ********************
    */
    setPicShow(state, data) {
      // if(data){
      //   state.videoShow = false;
      // }
      state.picShow = data;
    },
    
    /*
    * ******************** 
    *  显示实时数据
    * ********************
    */
    setSocketMessage(state, data) { 
      state.socketMessage = JSON.parse(data||'{}');
    },
     /*
    * ******************** 
    *  视屏弹窗url
    * ********************
    */
    setSocketVideoUrl(state,data){
      state.videoUrl = data;
    },
       /*
    * ******************** 
    *  控制隐藏
    * ********************
    */
    setShowOff(state, data) {
      state.showOff = data;
    },
    setShowOffRight(state, data) {
      state.showOffRight = data;
    },
         /*
    * ******************** 
    *  无人机
    * ********************
    */
    setPlaneData(state, data) {
   
      state.planeData.push(data)
   
    },
    setPlaneOff(state, data) {
      state.planeOff=data;
    },
    setHistoryOff(state,data){
      state.historyOff=JSON.parse(data);
    },
    setPlaneWinOff(state,data){
      state.planeWinOff=data;
    },
    setPlaneDataList(state,data){
      state.planeDataList=JSON.parse(data);
    }
  };
  export default {
    state,
    actions,
    mutations
  };
  